﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZoneLinePacking.Models.Entity.BaseInfo;
using ZoneLinePacking.Models.Entity.Template;
using ZoneLinePacking.Services.DB;

namespace ZoneLinePacking.Common {

    public class CodeCalculator {

        public static string GetCheckCode(TemplateEntity template, string code) {

            var mainDbOperate = PrismIocInfo.GetInstanceByIoc<IDbOperate<IFreeSqlMainContext>>();
            var product = mainDbOperate.GetModel<ProductEntity>(o => o.Id == template.ProductID);
            //CustomerID = 3 奇瑞
            if (product.CustomerID == 3) {
                return CheckCodeCalculator_T1N.Calculate(code).ToString();
            }
            return "-";
        }

    }


}
